package com.jiulan.hearthearing.widget;

import android.content.Context;
import android.graphics.Rect;
import android.view.View;

import androidx.recyclerview.widget.RecyclerView;

public class SpaceVerticalItemDecoration extends RecyclerView.ItemDecoration {
    private int dividerHeight;

    public SpaceVerticalItemDecoration(Context context, int dividerHeight) {
        this.dividerHeight = context.getResources().getDimensionPixelSize(dividerHeight);
    }

    @Override
    public void getItemOffsets(Rect outRect, View view, RecyclerView parent, RecyclerView.State state) {
        super.getItemOffsets(outRect, view, parent, state);
        outRect.bottom = dividerHeight;//类似加了一个bottom padding
    }

}
